//
//  OnMarketDetailTableViewCell.m
//  BSLCar
//
//  Created by 孙卓 on 15/5/26.
//  Copyright (c) 2015年 lyz. All rights reserved.
//

#import "OnMarketDetailTableViewCell.h"

@interface OnMarketDetailTableViewCell ()

@property (nonatomic, retain) UILabel *label;

@end

@implementation OnMarketDetailTableViewCell

//重写方法
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatMyCell];
    }
    return self;
}
//初始化添加
- (void)creatMyCell{
    self.engTypeLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.engTypeLabel];
    
    self.lowPriceLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.lowPriceLabel];
    
    self.insPriceLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.insPriceLabel];
    
    self.detailImage = [[UIImageView alloc] init];
    [self.contentView addSubview:self.detailImage];
    
    self.label = [[UILabel alloc] init];
    [self.contentView addSubview:self.label];
}
//设置样式
- (void)layoutSubviews{
    [super layoutSubviews];
    self.engTypeLabel.frame = CGRectMake(0, 5, self.bounds.size.width, 20);
    self.engTypeLabel.textAlignment = NSTextAlignmentCenter;
    self.engTypeLabel.font = [UIFont systemFontOfSize:20];
    
    self.detailImage.frame = CGRectMake(self.bounds.size.width - 175, 30, 160, 120);
    self.detailImage.backgroundColor = [UIColor clearColor];
    self.detailImage.layer.cornerRadius = 3;
    self.detailImage.layer.masksToBounds = YES;
    self.detailImage.contentMode = UIViewContentModeScaleAspectFit;
    
    self.lowPriceLabel.frame = CGRectMake(10, 50, 160, 36);
    self.lowPriceLabel.backgroundColor = [UIColor clearColor];
    self.lowPriceLabel.textAlignment = NSTextAlignmentLeft;
    self.lowPriceLabel.textColor = [UIColor purpleColor];
    self.lowPriceLabel.font = [UIFont systemFontOfSize:15];
    
    self.insPriceLabel.frame = CGRectMake(10, 100, 130, 36);
    self.insPriceLabel.backgroundColor = [UIColor clearColor];
    self.insPriceLabel.textAlignment = NSTextAlignmentLeft;
    self.insPriceLabel.textColor = [UIColor blueColor];
    self.insPriceLabel.font = [UIFont systemFontOfSize:15];
    
    self.contentView.frame = CGRectMake(5, 5, self.bounds.size.width - 10, 155);

    self.contentView.layer.cornerRadius = 5;
    self.contentView.layer.masksToBounds = YES;
    
    self.label.frame = CGRectMake(5, self.bounds.size.height - 6, self.bounds.size.width - 10, 1);
    self.label.backgroundColor = [UIColor grayColor];
    self.label.alpha = .4f;

}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
